<div class="layui-card-header SearchTable">
    测试代码：<span id="detail_name_str" class="color_green">表单的增删改</span>
</div>
<div class="layui-card-body">
<pre class="layui-code" lay-title="测试" lay-height="" lay-skin="" lay-encode="" about="false">
    layui.table.on('toolbar(table_1)', function (obj) {
            myTool.toolbar(this, obj, {
                AddTestDemo: function () {
                    index = top.layer.open({
                        type: 2, offset: '60px', area: ['700px', '550px'], title: ['添加开发测试', 'font-size:15px;'],
                        content: ["testdemo/AddTestDemo?p_id=" + $("#p_id").val(), 'no'],
                        end: function () {
                            tableindex.reload({});
                        }
                    });
                }
                , EditTestDemo: function () {
                    myTool.doSingleSelect(layui.myTable.checkStatus('table_1'), {}, function (data, keys) {
                        index = top.layer.open({
                            type: 2, offset: '60px', area: ['700px', '550px'], title: ['修改开发测试[' + data[0].test_id + ']', 'font-size:15px;'],
                            content: ["testdemo/EditTestDemo?test_id=" + data[0].test_id, 'no'],
                            end: function () {
                                tableindex.reload({});
                            }
                        });
                    });
                }
                , DelTestDemo: function () {
                    myTool.doSingleSelect(layui.myTable.checkStatus('table_1'), {}, function (data, keys) {
                        index = layer.confirm('你是否确认删除开发测试【' + data[0].test_id + '】', {icon: 3, title: '提示', offset: '100px'}, function (index2) {
                            myTool.postMsg("DelTestDemoApi", {
                                test_id: data[0].test_id
                            }, function () {
                                layer.close(index2);
                                tableindex.reload();
                            });
                        });
                    });
                }
            });
        });
</pre>

</div>